package com.cy.pj.common.service;

import com.cy.pj.common.pojo.Response;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExceptionService {
    private static final Logger log = LoggerFactory.getLogger(ExceptionService.class);

    @ExceptionHandler(ArithmeticException.class)
    public Response doHandleRuntimeException(ArithmeticException e) {
        log.error("is " + e.getMessage());
        return new Response(e);
    }
}
